package com.tang.lts.core.jvmmonitor.mbean;

import java.lang.management.ClassLoadingMXBean;
import java.lang.management.CompilationMXBean;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;
import java.util.Properties;

/**
 * @author Tang
 * @classname JVMInfo
 * @description [  ]
 * @date 2022/5/10 13:57
 */
public class JVMInfo implements JVMInfoMBean {

    private RuntimeMXBean runtimeMXBean;
    private ClassLoadingMXBean classLoadingMXBean;
    private CompilationMXBean compilationMXBean;
    private Properties properties;

    private static final JVMInfo instance = new JVMInfo();

    public static JVMInfo getInstance() {
        return instance;
    }

    private JVMInfo() {
        runtimeMXBean = ManagementFactory.getRuntimeMXBean();
        classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();
        compilationMXBean = ManagementFactory.getCompilationMXBean();
        properties = System.getProperties();
    }

    public String getProperties(String key) {
        return properties.getProperty(key);
    }

    @Override
    public Date getStartTime() {
        return null;
    }

    @Override
    public String getJVM() {
        return null;
    }

    @Override
    public String getJavaVersion() {
        return null;
    }

    @Override
    public String getPID() {
        return null;
    }

    @Override
    public String getInputArguments() {
        return null;
    }

    @Override
    public String getJavaHome() {
        return null;
    }

    @Override
    public String getArch() {
        return null;
    }

    @Override
    public String getOSName() {
        return null;
    }

    @Override
    public String getOSVersion() {
        return null;
    }

    @Override
    public String getJavaSpecificationVersion() {
        return null;
    }

    @Override
    public String getJavaLibraryPath() {
        return null;
    }

    @Override
    public String getFileEncode() {
        return null;
    }

    @Override
    public int getAvailableProcessors() {
        return 0;
    }

    @Override
    public int getLoadedClassCount() {
        return 0;
    }

    @Override
    public long getTotalLoadedClassCount() {
        return 0;
    }

    @Override
    public long getUnloadedClassCount() {
        return 0;
    }

    @Override
    public long getTotalCompilationTime() {
        return 0;
    }

    @Override
    public String getHostName() {
        return null;
    }

    @Override
    public String getLocalIp() {
        return null;
    }
}